<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>for..in循环</title>
</head>

<body>
    <div>for..in循环</div>
    <hr />
</body>
<div id="demoReact"></div>
<script src="../../node_modules/babel-standalone/babel.min.js"></script>
<script src="../../node_modules/react/umd/react.development.js"></script>
<script src="../../node_modules/react-dom/umd/react-dom.development.js"></script>
<script type="text/babel">

    let arr = [1,2,3,4,5,6,7];

    function fun() {
        let newArr = [];

        for (let index in arr) {
            newArr.push(<p key={index}>新闻{arr[index]}</p>);
        }
        return newArr;
    }

    let root = ReactDOM.createRoot(document.getElementById("demoReact"));
    root.render(fun());
</script>

</html>